﻿/**
* ...
* @author alijayameilio
*/

package particling;

import flash.display.Sprite;

import particling.emitter.ParticleEmitter;

class AParticle 
{

	public var container(default, null):Sprite;
	public var particleEmitter:ParticleEmitter;
	
	public var xSpeed(default, null):Float;
	public var ySpeed(default, null):Float;
	
	public var xForce(default, null):Float;
	public var yForce(default, null):Float;
	
	public var lifeTime:Int;
	public var rotationFollow:Bool;
	
	public function new(__particleConfig:ShapeConfig, __particleEmitter:ParticleEmitter, __lifeTime:Int, __rotationFollow:Bool) 
	{
		container = __particleConfig.createParticle();
		particleEmitter = __particleEmitter;
		
		changeSpeed(0, 0);
		
		changeForce(0, 0);
		
		lifeTime = __lifeTime;
		rotationFollow = __rotationFollow;
	}
	
	public function addSpeed(__xSpeed:Float, __ySpeed:Float): Void
	{
		xSpeed += __xSpeed;
		ySpeed += __ySpeed;
	}
	
	public function changeSpeed(__xSpeed:Float, __ySpeed:Float): Void
	{
		xSpeed = __xSpeed;
		ySpeed = __ySpeed;
	}
	
	public function addForce(__xForce:Float, __yForce:Float): Void
	{
		xForce += __xForce;
		yForce += __yForce;
	}
	
	public function changeForce(__xForce:Float, __yForce:Float): Void
	{
		xForce = __xForce;
		yForce = __yForce;
	}
	
}